package com.jinan.yzht.simple.simples;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author 东街浊酒づ
 * @date 2020/10/27
 */
@Component
// @PropertySource("classpath:/config/config.properties")
@PropertySource(value = "classpath:/config/config.yml", factory = YamlPropertySourceFactory.class)
@ConfigurationProperties(prefix = "simple.user")
public class PlaceHolderSimple {

    @Value("${simple.user.username}")
    private String userName;

    @Value("${simple.user.location}")
    private String location;

    public void printUser() {
        System.out.println("PlaceHolderSimple:=>user{ " + userName + "," + location + " }");
    }
}
